/**
 * Created by minigci.he on 16/10/31.
 */
console.log('-----------------------')
console.log('test2')

function foo({x, y=5}){
    console.log(x, y)
}
foo({})             // undefined 5
foo({x:1})          // 1 5
foo({x:1, y:2})     // 1 2
// foo()               // Uncaught TypeError: Cannot read property 'x' of undefined


function fetch(url, {method = 'GET'} = {}){
    console.log(method)
}
fetch('http://example.com')